package com.bookocean.infrastructure.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * JWT 配置属性类
 * 
 * @author BookOcean
 * @since 2024-01-01
 */
@Data
@Component
@ConfigurationProperties(prefix = "jwt")
public class JwtProperties {

    /**
     * JWT 密钥
     */
    private String secret = "bookOceanSecretKey2024ForJWT";

    /**
     * JWT 过期时间（毫秒）
     * 默认7天
     */
    private Long expiration = 604800000L;

    /**
     * JWT 令牌头部前缀
     */
    private String tokenPrefix = "Bearer ";

    /**
     * JWT 令牌请求头名称
     */
    private String headerName = "Authorization";

    /**
     * 是否启用JWT认证
     */
    private Boolean enabled = true;
}
